package com.xdb.sqlparser.ast.statement;

import java.util.List;

import com.xdb.sqlparser.ast.SQLCommentHint;
import com.xdb.sqlparser.ast.SQLStatement;
import com.xdb.sqlparser.ast.AbstractSQLStatementImpl;
import com.xdb.sqlparser.visitor.SQLAstVisitor;

public class SQLExplainStatement extends AbstractSQLStatementImpl {

	protected SQLStatement statement;

	private List<SQLCommentHint> hints;

	public SQLExplainStatement() {

	}

	public SQLExplainStatement(String dbType) {
		super(dbType);
	}

	public SQLStatement getStatement() {
		return statement;
	}

	public void setStatement(SQLStatement statement) {
		if (statement != null) {
			statement.setParent(this);
		}
		this.statement = statement;
	}

	@Override
	protected void accept0(SQLAstVisitor visitor) {
		if (visitor.visit(this)) {
			acceptChild(visitor, statement);
		}
		visitor.endVisit(this);
	}

	public List<SQLCommentHint> getHints() {
		return hints;
	}

	public void setHints(List<SQLCommentHint> hints) {
		this.hints = hints;
	}
}
